package com.sinosoft.emplmis.jobless.manager.impl;

import java.util.List;

import org.apache.log4j.Logger;

import com.github.pagehelper.PageHelper;
import com.sinosoft.emplmis.jobless.dao.KnryTrackingrecordMapper;
import com.sinosoft.emplmis.jobless.entity.KnryTrackingrecordEntity;
import com.sinosoft.emplmis.jobless.manager.KnryTrackingrecordManager;
import com.sinosoft.emplmis.jobless.web.dto.JoblessSearchData;

public class KnryTrackingrecordManagerImpl implements KnryTrackingrecordManager{
   
	private KnryTrackingrecordMapper knryTrackingrecordMapper;
	
	public KnryTrackingrecordMapper getKnryTrackingrecordMapper() {
		return knryTrackingrecordMapper;
	}

	public void setKnryTrackingrecordMapper(KnryTrackingrecordMapper knryTrackingrecordMapper) {
		this.knryTrackingrecordMapper = knryTrackingrecordMapper;
	}
	
	@Override
	public int insert(KnryTrackingrecordEntity Entity) {
		Logger.getRootLogger().info("为指定困难人员添加跟踪服务记录");
		return knryTrackingrecordMapper.insert(Entity);
	}
	
	@Override
	public List<KnryTrackingrecordEntity> selectAll(JoblessSearchData data,String unemployedId) {
		Logger.getRootLogger().info("获取指定困难人员跟踪服务记录");
		PageHelper.startPage(data.getPage(), data.getTotal());
		return knryTrackingrecordMapper.selectAll(unemployedId);
	}

	@Override
	public int deleteByPrimaryKey(String id) {
		Logger.getRootLogger().info("根据主键删除困难人员跟踪服务记录");
		return knryTrackingrecordMapper.deleteByPrimaryKey(id);
	}
	
	@Override
	public KnryTrackingrecordEntity selectByPrimaryKey(String id) {
		Logger.getRootLogger().info("根据主键回显困难人员的跟踪服务台账记录");
		return knryTrackingrecordMapper.selectByPrimaryKey(id);
	}

	@Override
	public int updateByPrimaryKey(KnryTrackingrecordEntity record) {
		Logger.getRootLogger().info("更新指定困难人员的跟踪服务记录");
		return knryTrackingrecordMapper.updateByPrimaryKey(record);
	}

	@Override
	public int count(String unemployedId) {
		Logger.getRootLogger().info("获取总条目数");
		return knryTrackingrecordMapper.count(unemployedId);
	}

	@Override
	public KnryTrackingrecordEntity getpicById(String id) {
		return knryTrackingrecordMapper.getpicById(id);
	}

}
